''' 文件上传'''
from selenium import webdriver
import os
from time import sleep
driver = webdriver.Chrome()
file_path = 'file:///' + os.path.abspath('upfile.html')
driver.get(file_path)

# 定位上传按钮，添加本地文件
driver.find_element_by_name('file').send_keys('F:/python_pj/selenium-study/upload_file.txt')
sleep(10)
driver.quit()